<template>
	<section  style="background: linear-gradient(70deg, #005fff, #0092ff);">
		 
		<div style="height:165px; background-color: #fff; width:100%; margin:auto;"></div>
		
		<div style="flex:1; height: 690px;  " class="box-center"> 
			<img src="res/home/man.png" style="position: absolute; top:11rem;"/>
			<img src="res/home/title.png" style="position: absolute; width: 775px; height:87; left:50%;margin-left:-387px; top:17rem;"/> 
			<div style="position: absolute;top:28rem; margin: auto; width: 38rem; ">
				<img v-if="checkClicked==false" src="res/home/btn-check.png" @click="check" style="position: absolute;left:0" />
				<img v-if="checkClicked" src="res/home/btn-check-down.png" style="position: absolute;left:0" />
				<img v-if="photoClicked==false" src="res/home/btn-photo.png" @click="photo"  style="position: absolute;right:0" />
				<img v-if="photoClicked" src="res/home/btn-photo-down.png" style="position: absolute;right:0" />
			</div> 
		</div>
		
		<div class="box-center"  style="height:165px; background-color: #fff; width:100%; margin: auto; ">
			<div style="margin: auto; width: 80rem; position: relative; ">
				<img src="res/home/logo.png" style="margin: 35px;"/>
				<img src="res/home/phone.png" style="right:0; margin: 65px; position: absolute;"/>
			</div> 
		</div>
		
	</section>
</template>

<script>
	export default{
		name:'Home',
		
		data(){
			return{
				checkClicked:false,
				photoClicked:false,
				url:this.$route.path,
			}
		},
		
		created(){
			const me = this;
			this.listen = function(data){
				alert("Home Listen: " + me.name + " " + JSON.stringify(data) );
			}
        },
		
		methods:{
			check(){
				this.checkClicked = true;
				this.delayRun(()=>{ 
					this.send({name:'SelectBusinessType', type:'check',remark:'用户选择体检加拍照',route:this.url });
					this.$router.push({path: '/check/input/business-type'})
					//this.toast('未实现此功能.')
					//this.imgCheck = 'res/home/btn-check.png';
				})
			},
			photo(){
				this.photoClicked = true;
				this.delayRun(()=>{ 
					this.send({name:'SelectBusinessType',type:'photo',remark:'用户选择拍照',route:this.url });
					this.$router.push({path: '/check/photo/photo-legal'})
					//this.toast('未实现此功能.')
					//this.imgPhoto = 'res/home/btn-photo.png';
				})
			},
		}
	}
</script>

<style>
</style>
